function Step4_figure_5()

clear; clc;
set(0, 'DefaultFigureRenderer', 'painter');
set(groot,'defaultFigurePaperPositionMode','auto')
 
%% folder settings
rootfolder = input('Enter the location for the rootfolder in single quotes (''''): \n');
inputfolder = [rootfolder '\figures\simulations\'];
outputfolder = [rootfolder '\figures\charts'];

%%
countries_effect_data = importdata([inputfolder,'matrix_dppi_for_matlab_graph.csv']);
matrix_effects = countries_effect_data.data(:,1:30);

country_line = countries_effect_data.textdata(2:31,1);
country_column = countries_effect_data.textdata(2:31,3);
for iii = 1:30
    temp = strcmp(country_line,country_column(iii));
    line = find(temp==1);
    matrix_effects(line,iii) = NaN;
end

%%
plot_matrix_effects = matrix_effects;

h=figure;

H = ribbon(plot_matrix_effects);
%hold on
%waterfall(plot_matrix_effects);
set(gca, 'Xtick', 1:30, 'XtickLabel' ,countries_effect_data.textdata(2:end,3) )
set(gca, 'Ytick', 1:30, 'YtickLabel' ,countries_effect_data.textdata(2:end,1))
set(gca,'FontSize',4)

colormap(copper)
alpha(0.8)
axis tight
xlabel('source')
ylabel('destination')
zlabel('impact (destination shock/source shock)')
camdolly(0,280,0.5,'targetmode','data')
xlabh = get(gca,'XLabel');
set(xlabh,'Position',get(xlabh,'Position') - [-5 0.4 0])
ylabh = get(gca,'YLabel');
set(ylabh,'Position',get(ylabh,'Position') - [-0.5 1.3 0])

set(h,'Units','Inches');
pos = get(h,'Position');
set(h,'PaperPositionMode','Auto','PaperUnits','Inches','PaperSize',[pos(3), pos(4)])


print('-depsc', [outputfolder '\fig5_3dplot.eps'], '-r0')
print('-dpdf', [outputfolder '\fig5_3dplot.pdf'], '-r0')

close all;
exit

end